Rob Gonda's Blog

JSMin for ColdFusion

JSMin is a utility to compress JavaScript by removing unnecessary whitespace and comments. Unlike obfuscation, it doesn't rename any of your variables or functions, leaving the core functionality intact. Depending on amount of comments, this utility may save from 50-80% on file size. Here's a good Minification Vs. Obfuscation article.

Darryl Lyons released CFJSMin, a ColdFusion utility to compress JavaScripts. I'm not sure why would you want to compress your scripts from a server side scripting language instead of running a binary executable... I guess that if you have a source folder and production folder you could automate changes... CFJSMin also has the ability of taking several input files and save them all in a single compressed file. This is good for caching.

Darryl, if you're reading this, here's a request: I'd like the tool to read several JS files as input, but instead of writing a target file, I'd like the output in a variable.

In addition of compressing your files, take a look at gzip and real time data compression. Here's a good article on how to set your IIS to compression. For those who run apache, I know it's really easy, but I don't have the information handy.

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?C4692A3C-3048-7431-E4194C8CBBB350A9

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
This blog is running version 5.9.003. Contact Blog Owner